package user.lan.com.util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;

import user.lan.com.usercenter.R;

/**
 * @Auth Mr.lc(兰超)
 * @Date 2016/11/9
 * @Time 11:21
 */
public class GlideUtils {
  /**
   * @Auth Mr.lc(兰超)
   * @Date 2016/11/9 14:03
   * 图片加载
   */
  public static void loadImage(String url, Context context, ImageView imageView) {
      Glide.with(context)
              .load(url)
              .placeholder(R.mipmap.ic_launcher)
              .error(R.mipmap.ic_launcher)
              .into(imageView);
  }
  /**
   * @Auth Mr.lc(兰超)
   * @Date 2016/11/9 14:17
   * 全尺寸缓存
   */
    public static void loadImageAll(String url, Context context, ImageView imageView){
        Glide.with(context)
                .load(url)
                .placeholder(R.mipmap.ic_launcher)
                .error(R.mipmap.ic_launcher)
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .into(imageView);
    }
}
